home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / exit.3 < prev    next >
Encoding:
Text File  |  1993-03-03  |  1.6 KB  |  67 lines

  1.  
  2.  
  3.  
  4. EXIT(3)             MINTLIB LIBRARY FUNCTIONS             EXIT(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        exit, _exit - terminate process
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        #include <stdlib.h>
  12.  
  13.        void exit(int status);
  14.  
  15.        #include <unistd.h>
  16.  
  17.        void _exit(int status);
  18.  
  19. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  20.        exit terminates the calling process in the following way:
  21.          -  All registered exit handlers are called (see atexit).
  22.          - Standard input, standard output, and standard error
  23.            output are flushed.
  24.          - All other open file descriptors are closed
  25.          - _exit is called with the argument passed to exit.
  26.  
  27.        Returning from main() with a value is identical to calling
  28.        exit with the same value.
  29.  
  30.        _exit  terminates  the  calling  process  without  cleanup
  31.        action:
  32.          - If profiling is active, profiling will be ended
  33.            and the results will be written out to file.
  34.          - Pterm is called with the argument passed to _exit.
  35.  
  36. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  37.        a✓at✓te✓ex✓xi✓it✓t(✓(3✓3)✓),✓, P✓Pt✓te✓er✓rm✓m(✓(2✓2)✓),✓, w✓wa✓ai✓it✓t(✓(3✓3)✓)
  38.  
  39. N✓NO✓OT✓TE✓ES✓S
  40.        The argument to exit is returned as the return code to the
  41.        calling  program. Zero should be returned on success, non-
  42.        zero should be returned on failure  or  abnormal  termina-
  43.        tion.
  44.  
  45.        The  Operating System does many things on process termina-
  46.        tion not mentioned above. For instance, memory  is  freed,
  47.        the  parent  process is signalled, file locks are released
  48.        and so on.
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.